package com.car.advertising.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;

import com.car.advertising.R;
import com.car.advertising.activity.adapter.CarOwnerMessageAdapter;
import com.support.widget.JumpManager;
import com.support.widget.interfacelistener.OnRecyclerViewItemClickListener;
import com.support.widget.layout.BaseRecylerViewToolBarActivity;

import java.util.ArrayList;
import java.util.List;

public class CarOwnerMessageActivity extends BaseRecylerViewToolBarActivity {

    private List<String> carOwnerMsgList = new ArrayList<>();

    @Override
    protected void initToolBar() {
        setTitleClickable(false);
        setSubtitleClickable(true);
        setToolBarBackgroundColor(R.color.color_white);
        setToolBarTitle("车主认证信息");
        setToolBarTitleColor(R.color.black_bg);

        setPullDownEnabled(false);
        setPullUpEnabled(false);
    }

    @Override
    protected void init() {
        carOwnerMsgList.add("车辆基本信息，车牌、车型、注册日期");
        carOwnerMsgList.add("车辆认证信息，行驶证、驾驶证");
        CarOwnerMessageAdapter ownerMessageAdapter = new CarOwnerMessageAdapter(CarOwnerMessageActivity.this, carOwnerMsgList);
        initRecyclerView(ownerMessageAdapter);
        ownerMessageAdapter.setOnItemClickListener(carOwnerItemListener);
    }

    private OnRecyclerViewItemClickListener carOwnerItemListener = new OnRecyclerViewItemClickListener() {

        @Override
        public void onItemClick(ViewGroup parent, View view, int position) {
            if (position == 0) {
                Bundle bundle = new Bundle();
                JumpManager.gotoActivityForResult(CarOwnerMessageActivity.this, CarOwnerBasicActivity.class, false, bundle, 2);
            } else if (position == 1) {
                JumpManager.gotoActivity(CarOwnerMessageActivity.this, CarOwnerAuthenticationActivity.class, false);
            }
        }
    };

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == 2) {
            finish();
        }
    }

    @Override
    public String getCN() {
        return null;
    }

    @Override
    public void LogoutCallback(boolean islogin) {

    }

    @Override
    public void onCritClick(View v) {

    }

    @Override
    protected boolean isClickable() {
        return false;
    }

    @Override
    protected void subtitleClick() {

    }

    @Override
    protected void titleClick() {

    }

    @Override
    protected void rightClick() {

    }

    @Override
    protected void onRefreshFinish() {

    }

    @Override
    protected void onLoadMoreFinish() {

    }
}
